<html>
<head>
<meta charset="UTF-8">
<title>业务系统数据源列表</title>
<link id="easyuiTheme" id="easyuiTheme" href="../../static/easyui/themes/bootstrap/easyui.css" rel="stylesheet" type="text/css"/>
<link href="../../static/easyui/themes/icon.css" rel="stylesheet" type="text/css"/>
<script src="../../static/easyui/jquery.min.js" type="text/javascript"></script>
<script src="../../static/easyui/jquery.cookie.js" type="text/javascript"></script>
<script src="../../static/easyui/ui-theme.js" type="text/javascript"></script>
<script src="../../static/easyui/jquery.easyui.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../static/easyui/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>
<script src="../../static/plugin/assets/jslib.util.js" type="text/javascript"></script>
<script src="../../static/plugin/assets/jslib.jquery.ajax.js" type="text/javascript"></script>
<script src="../../static/plugin/assets/jslib.easyui.util.js" type="text/javascript"></script>
<script src="../../ffres/dict/all.js" type="text/javascript"></script>
<a href="" target="_blank" id="commonLink" name="commonLink"></a>
</head>
<script type="text/javascript">

	$(function () {
		addTitle("选择应用数据源");
	})

	function onDblClickRow(index,subsDsCode) {
    	window.parent.chooseSSubsDatasource(subsDsCode);
    	window.parent.JLEUtil.closewin();
	}

	function selectReturn() {
   	 	var row = $('#dg').datagrid('getSelected');
    	if (row) {
       	 	onDblClickRow(-1, row.subsDsCode);
		} else {
			$.messager.alert('提示', '请选择一条记录！', 'info');
		}
	}

	function closeForm() {
	    window.parent.JLEUtil.closewin();
	}
	
	
	function reloadList(){
	    $('#dg').datagrid('reload');
	    JLEUtil.closewin();
	};
	
</script>
</head>
<body class="easyui-layout">
<div data-options="region:'north'" style="height: 28px;" >
	<div class="esaas-info-title2" style="height: 26px;background-color: #205081;" >
		<div style="padding: 2px;font-size: 14px;color:white">&nbsp;&nbsp;选择应用数据源</div>
		<a class="easyui-menubutton" style="position:absolute;right: 5px;top: 1px;width:26px;height: 26px;background-image: url('../../static/easyui/themes/icons/cancel6.png')" onclick="closeForm()">
		</a>
	</div>
</div>
<div data-options="region:'center',split:false">
	<div data-options="region:'north',title:''" style="height: 35px;">
	<form id="searchForm">
		<table>
			<tr>
				<td>&nbsp;业务系统代码：</td>
				<td><input name="subsCode" id="subsCode"/></td>
				<td>&nbsp;数据源代码：</td>
				<td><input name="subsDsCode" id="subsDsCode"/></td>
				<td><a class="easyui-linkbutton" href="javascript:void(0);" onclick="JLEUtil.queryForm('searchForm','dg','../../api/s/subs/datasources');">查找</a></td>
				<td><a class="easyui-linkbutton" href="javascript:void(0);" onclick="JLEUtil.clearForm('searchForm');">清空</a></td>
			</tr>
		</table>
	</form>
	</div>
	<table id="dg" class="easyui-datagrid" title="" style="width:100%;height:93%"
		   data-options="singleSelect:true,collapsible:true,url:'../../api/s/subs/datasources/'+$.getUrlParam('subsCode'),method:'post'"
		   toolbar="#tb"
		   title="Load Data"
		   rownumbers="true" pagination="true" pageSize="20">
		<thead>
		<tr>
			<th data-options="field:'subsCode',resizable:true" >业务系统代码</th>
			<th data-options="field:'subsDsCode',resizable:true" >数据源代码</th>
			<th data-options="field:'subsDsName',resizable:true" >数据源名称</th>
			<th data-options="field:'dsConnStr',resizable:true" >数据源-连接字符串</th>
			<th data-options="field:'dsUserId',resizable:true" >数据源-用户名</th>
			<th data-options="field:'dsUserPwd',resizable:true" >数据源-用户密码</th>
			<th data-options="field:'dsSchemaName',resizable:true" >数据源-模式</th>
			<th data-options="field:'dsDbName',resizable:true" >数据源-数据库名</th>
			<th data-options="field:'subsDsType',resizable:true" formatter="formatter_S_SUBS_DS_TYPE">数据源类型</th>
		</tr>
		</thead>
	</table>
</div>
<div data-options="region:'south',split:false" style="height: 55px;">
	<div style="text-align: center; padding: 10px 0px 25px;height: 10%;">
		<a href="javascript:void(0)" class="easyui-linkbutton"
		   onclick="selectReturn()">&nbsp;选择返回&nbsp;</a>
		<a href="javascript:void(0)" class="easyui-linkbutton"
		   onclick="closeForm()">&nbsp;&nbsp;关&nbsp;&nbsp;&nbsp;闭&nbsp;&nbsp;</a>
	</div>
</div>
</body>
</html>
